import request from '@/utils/request'

//根据name条件获取菜品分类、套餐分类的列表（分页）
export const reqGetCategoryList = (params) => {
  return request.get('/category/page', {
    params
    // 以上与 params: { ...params } 等价
  })
}

//根据name条件获取菜品分类、套餐分类的列表（不分页）
export const reqGetCategoryListNoPage = (params) => {
  return request.get('/category/list', {
    params: { ...params }
  })
}

//新增分类
export const reqAddCategory = (data) => request.post('/category', data)

// 修改接口
export const reqEditCategory = (params) => {
  return request.put('/category', { ...params })
}

// 删除当前列的接口
export const reqDeleteCategory = (id) => {
  return request.delete('/category', { params: { id } })
}
